
function bindAuditOpinion(applyid,instanceid){
	$.ajax({ 
		url: basePath() + 'business/getauditopinion.do',
		data: {"applyid": applyid,"instanceid":instanceid},
		dataType: "json",
        contentType: "application/json",
		success: function(data){
			if(data.result == 0){
				$('#approvalInfo').html('<h3>无审批数据</h3>');
			}
			else {
				var opinionData = data.datas;
				for(var i = 0; i < opinionData.length; i++){
					var nodename = opinionData[i].nodename;
					var username = opinionData[i].username;
					var audittime = formatDate(opinionData[i].audittime, 'yyyy-mm-dd hh:mi');
					var orgname = opinionData[i].orgname;
					var opinion = opinionData[i].opinion;
					var opinionid = opinionData[i].opinionid;
					var htmlStr = 	'<tr> '+
									'	<td class="tdTitle" rowspan="3" style="vertical-align: middle;">'+
									'		'+ nodename +''+
									'	</td>'+
									'	<td class="tdTitle">'+
									'		用户'+
									'	</td>'+
									'	<td>'+
									'		'+ username +''+
									'	</td>'+
									'	<td class="tdTitle">'+
									'		操作时间'+
									'	</td>'+
									'	<td>'+
									'		'+ audittime +''+
									'	</td>'+
									'	<td class="tdTitle">'+
									'		所属机构'+
									'	</td>'+
									'	<td>'+
									'		'+ orgname +''+
									'	</td>'+
									'</tr>'+
									'<tr>'+
									'	<td class="tdTitle">'+
									'		意见'+
									'	</td>'+
									'	<td colspan="5">'+
									'		'+ opinion +''+
									'	</td>'+
									'</tr>'+
									'<tr>'+
									'	<td class="tdTitle">'+
									'		附件'+
									'	</td>'+
									'	<td colspan="5" id="annex'+opinionid+'">'+		
									'	</td>'+
									'</tr>';
					$('#auditopinion').append(htmlStr);
					
//					if(nodename == '业务初审' && '' == $('#supervisecer').val()){   //绑定证书的监管意见
//						$('#supervisecer').val(opinion);
//					}
					if(nodename == '业务审批'){   //绑定证书的监管意见
						$('#certificatedate').val(formatDate(opinionData[i].audittime, 'yyyy-mm-dd'));
					}
					$.ajax({ 
						url: basePath() + 'business/getaduitannex.do',
						data: {"opinionid": opinionid},
						dataType: "json",
						async:false,
				        contentType: "application/json",
						success: function(data){
							if(data.result == 1){
								for(var j=0; j<data.datas.length; j++){
									var html='<a target="_blank" href="/gahCMP/business/getannexidbyid.do?annexid='+data.datas[j].annexid+'"><button type="button" class="btn btn-link">'+data.datas[j].filename+'</button></a>';
						             $("#annex"+opinionid).append(html);  
								}
							}
				      	}
					});
				}
			}
      	}
	});
}